<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ include file="head.jsp" %>
<style>
	body{background: none;};
</style>
<form id="listForm" method="get">
    <div id="toolBar">
    
    	<a class="edit" href="javascript:void(0)" ActionUrl="<%=path%>/admin/checked-house.do" ConfirmMessage="确定通过审核所选？？" >通过审核</a>
     
        <a class="edit" href="#" GotoUrl="<%=path%>/admin/publish-house.do?hid=" IdType="Single">修改</a>

        <a class="delete" href="javascript:void(0)" rel="<%=path %>/admin/delete-house.do" >删除</a>

        <span><input type="text" id="keywords" name="keywords" value="${keywords }" defaultText="关键字"/></span>
        <input type="button" value="查询" onclick="doSearchHouse()"/>
    </div>
</form>
<div id="list">
    <table class="commonTable">
        <tr class="titleTr">
            <th style="width:30px"><input id="select_all" type="checkbox" /></th>
            <th>标题</th>
            <th>地址</th>
            <th>状态</th>
            <c:if test="${jspUserO.role=='0' }"><th>创建人</th></c:if>
            <th>发生时间</th>
        </tr>
        <c:forEach var="item" items="${list}">  
        <tr onclick="window.open('<%=path %>/house/housecontent.do?hid=${item.HID }');">
            <td align="center">
                <input value="${item.HID }" State="1" name="ids" type="checkbox" />
            </td>
            <td>${item.HNAME }</td>
            <td>${item.ADDRESS }</td>

            <td align="center">                
                <c:choose>
				<c:when test="${item.STATUS==0 }">
					<span class="fcr">
					  		待审核
					</span>
				</c:when>
				<c:otherwise><span class="fcgreen">已审核</span></c:otherwise>
				</c:choose>				
            </td>
            <c:if test="${jspUserO.role=='0' }">
            <td align="center">${item.USER_ID }</td>
            </c:if>
            <td align="center">${item.DISPLAYDATE }</td>

        </tr>
        </c:forEach>
        <c:if test="${not empty list }">
        <tr>
	        <td colspan="<c:choose><c:when test="${jspUserO.role=='0' }">6</c:when>
				<c:otherwise>5</c:otherwise>
				</c:choose>	" align="right">
	        	<jmu:pager totalPage="${totalPage }" currentPage="${currentPage }"></jmu:pager>
	        </td>
        </tr>
        </c:if>
    </table>
</div>
<script>
	function doSearchHouse() {	  
	    window.location.href = "<%=path%>/admin/my-house.do?keywords=" + encodeURI(encodeURI($("#keywords").val()));
	}

</script>

</body>
</html>
